home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / text / edit / gad4ged4.lha / gad4ged4 / arexx / sc / smake.ged < prev   
Text File  |  1996-10-03  |  3KB  |  112 lines

  1. /* smake.ged V1.01  inspired by dmake.ged of Dietmar Eilert
  2.    written in 1994 by Roland Schwingel
  3.                       Lilienthalstraße 9
  4.                       92421 Schwandorf
  5.                       Germany
  6.  
  7.    Description:
  8.    Calls smake utility (SAS/C).
  9.    When there is a makefile in the current drawer then 'smake'
  10.    is invoked ELSE the current file is compiled using 'sc'.
  11.  
  12.    Changes:
  13.    looks for "smakefile" (koessi)
  14. */
  15.  
  16. IF (Left(ADDRESS(), 6) ~= "GOLDED") THEN    /* not started BY GoldEd ? */
  17.   ADDRESS 'GOLDED.1'
  18.  
  19. OPTIONS RESULTS                             /* enable RETURN codes     */
  20.  
  21. 'LOCK CURRENT RELEASE=4'                        /* lock GUI, gain access   */
  22. OPTIONS FAILAT 25                            /* ignore warnings         */
  23. SIGNAL ON SYNTAX                            /* ensure clean EXIT       */
  24. SIGNAL ON ERROR
  25.  
  26. /* ------------------------- INSERT YOUR CODE HERE: -------------------- */
  27.  
  28. ARG scopts
  29.  
  30. PARSE SOURCE xtype xresults xcalled xresolved xextension xhost
  31.  
  32. CALL SetClip('first_error_file')
  33. CALL SetClip('prev_error_file' )
  34. CALL SetClip('first_error_line')
  35. CALL SetClip('prev_error_line' )
  36.  
  37. IF Show('P', 'SC_SCMSG') THEN DO
  38.   ADDRESS 'SC_SCMSG' 'Quit'
  39. END
  40.  
  41. 'QUERY CAT'
  42. IF (RESULT = "deutsch") THEN DO
  43.   savebody = "Datei wurde verändert. Speichern ?"
  44.   savebutt = "Speichern|Nicht speichern"
  45.   donebutt = "Fertig"
  46.   fail_msg = ": Tragische Fehler - Kompilieren ging daneben"
  47.   cont_msg = "Weiter mit return ..."
  48. END
  49. ELSE DO
  50.   savebody = "File has been changed. Save it ?"
  51.   savebutt = "Save|Do not save"
  52.   donebutt = "Ready"
  53.   fail_msg = ": Fatal Errors - compiling failed"
  54.   cont_msg = "Press return to continue ..."
  55. END
  56.  
  57. /* cpu  = 'etc:util/boot/set040' */
  58. make = 'sc:c/smake '||scopts
  59. cc   = 'sc:c/sc BUILDPROJECT'
  60.  
  61. 'QUERY MODIFY'
  62.  
  63. IF (RESULT = 'TRUE') THEN DO
  64.   'REQUEST TITLE="'||xcalled||'" BODY="'||savebody||'" BUTTON="'||savebutt||'"'
  65.  
  66.   IF (RESULT = 1) THEN
  67.    'SAVE ALL'
  68. END
  69.  
  70.  
  71. 'QUERY PATH'
  72. pfad = RESULT
  73.  
  74. CALL Pragma('D', pfad)
  75.  
  76. 'DIR "'||pfad||'"'
  77.  
  78. IF Exists('smakefile') THEN DO
  79.   'UNLOCK'
  80.   DRESS COMMAND make
  81.   SIGNAL NOERROR
  82. END
  83. ELSE
  84. DO
  85.   'UNLOCK'
  86.   DRESS COMMAND cc
  87.   IF RC = 0 THEN DO
  88.     'REQUEST TITLE="'||xcalled||'" BODY="'||cc||'" BUTTON="'||donebutt||'"'
  89.     SIGNAL READY
  90.   END
  91. END
  92.  
  93. ERROR:
  94. SAY '0a'x||'0a'x||'9b'x||'33m'||xcalled||fail_msg
  95.  
  96. NOERROR:
  97. SAY '9b'x||'32m'||cont_msg
  98.  
  99. PULL dummy
  100.  
  101. READY:
  102. /* ---------------------------- END OF YOUR CODE ----------------------- */
  103.  
  104. EXIT
  105.  
  106. SYNTAX:
  107.  
  108. SAY "Sorry, error line" SIGL ":" ErrorText(RC) ":-("
  109. ADDRESS 'GOLDED.1' 'UNLOCK'
  110. EXIT
  111.  
  112.